<template>
	<view class="">
		<view class="content">
			<!-- 头部banner -->
			<!-- <detail-swiper :list="swiperList"></detail-swiper> -->
			
			<view class="topBg"></view>
			
			<view class="content_info">

				<!-- 活动具体信息 -->
				<detail-info :activityTitle="activityInfo.activityName"
					:activiyTime="activityInfo.timeStart+'至'+activityInfo.timeEnd" :finishTime="activityInfo.timeEnd">

					<view class="other-content" slot="other">
						<image class="seckillTitleBg" src="/marketing/static/activity/seckillBg.png" mode=""></image>

						<view class="seckillInfo">
							<text class="seckillTitle">秒杀价</text>
							<view class="nowPrice">¥
								<text style="font-size: 36upx;color: #ec4863;">{{activityInfo.nowPrice}}</text>
							</view>
							<text class="countNumber">仅剩{{activityInfo.countNumber - activityInfo.number}}份</text>
						</view>


						<view class="costPrice">¥{{activityInfo.costPrice}}</view>

					</view>
				</detail-info>

				<!-- 活动门店 -->
				<view v-if="activityInfo.unitDto">
					<home-title title="活动门店" type="2"></home-title>
					<view style="margin-bottom: 10upx;" v-for="(item, index) in activityInfo.unitDto" :key="index">
						<store-cell :isLocation="0" :storeName="item.storeName" :storeAddress="item.address"
							:distance="item.distance" :phone="item.contactPhone" :latitude="item.lat"
							:longitude="item.lon"></store-cell>
					</view>
				</view>

				<!-- 活动商品 -->
				<view v-if="activityInfo.goodsVoList">
					<home-title title="商品说明" type="2"></home-title>
					<view style="margin-bottom: 10upx;" v-for="(item, index) in activityInfo.goodsVoList" :key="index">
						<detail-commodity :commodityTitle="item.goodsServerName"
							:commodityDesc="item.goodsServerDescribe" :count="item.goodsServerNumber"
							:totalAmount="item.goodsServerPrice"
							:totalPrice="'{{item.goodsServerNumber * item.goodsServerPrice}}'"></detail-commodity>
					</view>
				</view>

				<!-- 活动介绍 -->
				<view>
					<detail-introduce :richInfo="activityInfo.content"></detail-introduce>
				</view>
				
			</view>
		</view>
		<!-- 底部按钮 -->
		<!-- <view class="bottomView">
			<view class="btn leftBtn">
				分享好友
			</view>
			<view class="btn rightBtn" >
				立即抢购
			</view>
		</view> -->
	</view>
</template>

<script>
	import detailInfo from '@/components/activity/activity-detailInfo.vue'
	import homeTitle from '@/components/activity/mmv-home-title.vue'
	import storeCell from '@/components/activity/store-cell.vue'
	import detailCommodity from '@/components/activity/activity-detailCommodity.vue'
	import detailIntroduce from '@/components/activity/activity-detailIntroduce.vue'

	import {
		apiActivityInfo,
	} from '@/api/marketingB-helper.js'
	export default {
		components: {
			detailInfo,
			homeTitle,
			storeCell,
			detailCommodity,
			detailIntroduce
		},
		data() {
			return {
				activityId: '',
				activityInfo: {},
			}
		},
	
		methods: {
			//获取详情数据
			getData() {
				apiActivityInfo({
					bizNo: this.activityId
				}).then(res => {
					this.activityInfo = res.data;
				})
			},

		
		},
		onLoad(op) {
			console.log(op);
			this.activityId = JSON.parse(op.param).bizNo;
			this.getData();
		}

	}
</script>

<style lang="scss" scoped>
	
	.content {
		// margin-bottom: 100upx;

		&_info {
			padding: 0 30upx;
			position: relative;
			top: 40upx;
		}
	}

	.secondKill {
		margin: 10upx 0;
		position: relative;
	}

	.seckillInfo {
		// position: relative;
		display: flex;
		justify-content: space-around;
		align-items: center;
		// vertical-align: bottom;
	}

	.seckillTitle {
		color: #fff;
		font-size: 22upx;
		z-index: 100;
		margin-left: 8upx;
	}

	.nowPrice {
		font-size: 22upx;
		font-family: PingFang SC, PingFang SC-Bold;
		font-weight: bold;
		font-style: italic;
		text-align: left;
		color: #ec4863;
		// margin-top: 23upx;
		margin-left: 15upx;
		margin-right: 23upx;
	}

	.countNumber {
		font-size: 24upx;
		font-family: PingFang SC, PingFang SC-Bold;
		// font-weight: bold;
		// text-align: left;
		color: #ec4863;
	}

	.costPrice {
		font-size: 28upx;
		font-family: PingFang SC, PingFang SC-Medium;
		// font-weight: bold;
		font-style: italic;
		// text-align: left;
		text-decoration: line-through;
		color: #999999;
		margin-top: 23upx;
	}

	.other-content {
		position: relative;
	}

	.seckillTitleBg {
		top: 6upx;
		left: 0;
		position: absolute;
		width: 86upx;
		height: 38upx;
	}

	.bottomView {
		display: flex;
		width: 100%;
		height: 96upx;
		line-height: 96upx;
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 3;
	}

	.btn {
		width: 50%;
		line-height: 100%;
		font-size: 33upx;
		display: flex;
		justify-content: center;
		align-items: center;
		position: relative;
	}

	.leftBtn {
		color: #666;
		background-color: #FFFFFF;
		height: 96upx;
		line-height: 96upx;
		align-self: center;
		text-align: center;
	}

	.rightBtn {
		color: #fff;
		background-color: $main-color;
	}

	.goods {
		padding-top: -20upx;
	}
</style>
